package com.atom.app;


import android.app.Activity;
import android.os.Bundle;

import com.atom.annotation.ApiImpl;
import com.atom.annotation.api.ApiImplCallback;
import com.atom.annotation.api.ApiImplContext;
import com.atom.app.base.AbstractActivity;
import com.atom.app.base.AbstractFragment;
import com.atom.module.logger.Logger;

@ApiImpl(api = Activity.class , name = "main")
public class MainActivity extends AbstractActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    protected void onStart() {
        super.onStart();
        apiImplContext().getImpl(AbstractFragment.class, "main/menu", new ApiImplCallback<AbstractFragment>() {
            @Override
            public void call(ApiImplContext apiImplContext, AbstractFragment abstractFragment) {
                Logger.e("apiImplContext()");
                loadFragment(abstractFragment, true);
            }
        });
    }

    @Override
    protected int getFrameLayout() {
        return R.id.widget_frame;
    }
}